import request from '@/utils/request'
import { CHECC_API_CMS } from '@/constants/proxy'
import {exportMethod} from '@/utils/utils'
import * as proxy from '@/constants/proxy'

const getProductList = (projectName) => {
  return request.post( CHECC_API_CMS +`/xmzx/acceptanceProject/getProductList?projectName=` + projectName);
};
const terminate = (params:any = {}) => {
  return request.post( CHECC_API_CMS +`/xmzx/acceptanceProject/update`, params);
};
const acceptanceProjects = (params:any = {}) => {
  return request.post( CHECC_API_CMS +`/xmzx/acceptanceProject/update`, params);
};
const acceptanceSave = (params:any = {}) => {
  return request.post( CHECC_API_CMS +`/xmzx/acceptanceProject/insert`, params);
};
const getDetail = (id) => {
  return request.post( CHECC_API_CMS +`/xmzx/acceptanceProject/getProductDetail?id=` + id);
};
//导出
export function getExportExcel(data: any) {
  const params = {
    method:'post',
    url: CHECC_API_CMS + '/xmzx/acceptanceProject/export?projectName=' + data,
    fileName:'项目验收列表'
  }
  console.log(data)
  return exportMethod(params)
}
export { getProductList, terminate, acceptanceProjects, getDetail, acceptanceSave }
